package com.ynet.middleground.riskmanage.service.impl;

import java.util.List;

import javax.validation.Valid;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.google.common.base.Throwables;
import com.ynet.core.common.BaseReqObj;
import com.ynet.core.common.ServiceResult;
import com.ynet.core.exception.BusinessException;
import com.ynet.core.log.IfpLogger;
import com.ynet.middleground.riskmanage.bean.*;
import com.ynet.middleground.riskmanage.dto.*;
import com.ynet.middleground.riskmanage.model.QccModel;
import com.ynet.middleground.riskmanage.model.ServicesModel;
import com.ynet.middleground.riskmanage.service.QccService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

/**
 * @author liulx
 * @description 企查查服务定义实现
 * @date 2020-08-04 21:59
 */
@Produces({MediaType.APPLICATION_JSON + "; " + "charset=UTF-8"})
@Consumes({MediaType.APPLICATION_JSON + "; " + "charset=UTF-8"})
@Api(value = "企查查接口服务", tags = {"企查查接口服务"})
@Path("qcc")
@Service(timeout = 6000, version = "0.0.1")
public class QccServiceImpl implements QccService, GenericService {

    @Autowired
    private QccModel qccModel;

    @Autowired
    private ServicesModel servicesModel;

    /**
     * 查询对接企查查的服务列表
     *
     * @param req 基础请求对象
     * @return 企查查接口列表
     */
    @POST
    @Path("services")
    @ApiOperation(value = "查询对接企查查的服务列表", notes = "查询已对接企查查的服务接口列表")
    @ApiImplicitParam(name = "requestObj", dataType = "BaseReqObj", paramType = "body", required = true)
    @Override
    public ServiceResult<List<ServiceDTO>> listServices(@Valid BaseReqObj req) {
        ServiceResult<List<ServiceDTO>> result = new ServiceResult<>();
        try {
            result.setResult(servicesModel.listServicesForQicahca(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询对接企查查的服务列表服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 企查查服务统计查询<br>
     * <note> 统计查询服务，分渠道和内管两部分，是为了防止渠道查询所有统计信息 </note>
     *
     * @param req 企查查服务统计查询请求信息
     * @return 统计查询结果列表
     */
    @POST
    @Path("tatistic")
    @ApiOperation(value = "企查查服务统计查询", notes = "企查查服务统计查询")
    @ApiImplicitParam(name = "requestObj", dataType = "QccStatisticQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<QccStatisticDTO>> tatisticQuery(@Valid QccStatisticQueryReqPager req) {
        ServiceResult<List<QccStatisticDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.tatisticQueryForChannel(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "企查查统计查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 企查查服务统计查询，内管专用
     *
     * @param req 企查查服务统计查询请求信息
     * @return 统计查询结果列表
     */
    @ApiOperation(value = "企查查服务统计查询-内管专用", notes = "企查查服务统计查询-内管专用", hidden = true)
    @Override
    public ServiceResult<List<QccStatisticDTO>> tatisticQueryForPortAdmin(@Valid QccStatisticQueryReqPager req) {
        ServiceResult<List<QccStatisticDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.tatisticQueryForPortAdmin(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "企查查统计查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 查询企业工商信息详情
     *
     * @param req 查询企业基础数据请求信息
     * @return 企业工商详情信息传输对象
     */
    @POST
    @Path("basic")
    @ApiOperation(value = "查询企业工商信息详情", notes = "查询企业工商详情信息")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBasicQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<QichachaAicDetailDTO> getBasicDetailsByName(@Valid CompanyBasicQueryReq req) {
        ServiceResult<QichachaAicDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.getBasicDetailsByName(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询企业工商信息详情服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 查询企业对外投资列表
     *
     * @param req 分页查询公司信息基础请求信息
     * @return 对外投资列表
     */
    @POST
    @Path("investment")
    @ApiOperation(value = "企业对外投资核查,,每页条数最大不超过20", notes = "企业对外投资核查")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<InvestmentDTO>> listInvestment(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<InvestmentDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listInvestment(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询企业对外投资核查服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 查询股东列表
     *
     * @param req 企查查分页查询通用基础请求信息
     * @return 股东列表
     */
    @POST
    @Path("partner")
    @ApiOperation(value = "查询股东列表", notes = "查询股东列表信息")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<PartnerDTO>> listPartner(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<PartnerDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listPartner(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询股东列表信息服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 查询主要人员列表
     *
     * @param req 企查查分页查询通用基础请求信息
     * @return 主要人员列表
     */
    @POST
    @Path("employee")
    @ApiOperation(value = "查询主要人员列表", notes = "查询主要人员列表信息")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<EmployeeDTO>> listEmployee(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<EmployeeDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listEmployee(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询主要人员列表服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 查询分支机构列表
     *
     * @param req 企查查分页查询通用基础请求信息
     * @return 主要人员列表
     */
    @POST
    @Path("branch")
    @ApiOperation(value = "查询分支机构列表", notes = "查询分支机构列表")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<BranchDTO>> listBranch(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<BranchDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listBranch(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询分支机构列表服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 变更记录
     *
     * @param req 查询企业基础数据请求信息
     * @return 变更记录列表
     */
    @POST
    @Path("change")
    @ApiOperation(value = "查询变更记录信息", notes = "查询变更记录信息列表")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBasicQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<List<ChangeDTO>> listChange(@Valid CompanyBasicQueryReq req) {
        ServiceResult<List<ChangeDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listChange(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询变更记录信息服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 开庭公告查询
     * 
     * @param req 查询开庭公告请求信息
     * @return 开庭公告信息
     * @author songyf 2020-08-07
     */
    @POST
    @Path("court-notice")
    @ApiOperation(value = "开庭公告核查,每页条数最大不超过20", notes = "开庭公告核查")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<QccCourtNoticeDTO>> searchCourtNotice(@Valid CourtNoticeQueryReqPager req) {
        ServiceResult<List<QccCourtNoticeDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchCourtNotice(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "开庭公告核查服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 开庭公告详情查询
     * 
     * @param req 查询开庭公告详情请求信息
     * @return 开庭公告详情信息
     * @author songyf 2020-08-10
     */
    @POST
    @Path("court-notice-detail")
    @ApiOperation(value = "开庭公告详情", notes = "开庭公告详情")
    @ApiImplicitParam(name = "requestObj", dataType = "CourtNoticeDetailQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<QccCourtNoticeDetailDTO> searchCourtNoticeDetail(@Valid CourtNoticeDetailQueryReq req) {
        ServiceResult<QccCourtNoticeDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchCourtNoticeDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "开庭公告详情查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 裁判文书查询
     * 
     * @param req 查询裁判文书
     * @return 裁判文书信息
     * @author songyf 2020-08-11
     */
    @POST
    @Path("judgment-doc")
    @ApiOperation(value = "裁判文书核查,每页条数最大不超过20", notes = "裁判文书核查")
    @ApiImplicitParam(name = "requestObj", dataType = "JudgmentDocQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<JudgmentDocDTO>> searchJudgmentDoc(@Valid JudgmentDocQueryReqPager req) {
        ServiceResult<List<JudgmentDocDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchJudgmentDoc(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "裁判文书核查服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 裁判文书详情查询
     * 
     * @param req 裁判文书详情请求信息
     * @return 裁判文书详情信息
     * @author songyf 2020-08-11
     */
    @POST
    @Path("judgment-doc-detail")
    @ApiOperation(value = "裁判文书详情", notes = "裁判文书详情")
    @ApiImplicitParam(name = "requestObj", dataType = "JudgmentDocDetailQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<JudgmentDocDetailDTO> searchJudgmentDocDetail(@Valid JudgmentDocDetailQueryReq req) {
        ServiceResult<JudgmentDocDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchJudgmentDocDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "裁判文书详情查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 法院公告列表信息查询
     * 
     * @param req 查询法院公告列表信息
     * @return 法院公告列表信息
     * @author songyf 2020-08-11
     */
    @POST
    @Path("court-announcement")
    @ApiOperation(value = "法院公告核查，每页条数最大不超过20", notes = "法院公告核查")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body",
        required = true)
    @Override
    public ServiceResult<List<CourtAnnouncementDTO>>
        searchCourtAnnouncement(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<CourtAnnouncementDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchCourtAnnouncement(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "法院公告核查服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 法院公告详情查询
     * 
     * @param req 法院公告详情请求信息
     * @return 法院公告详情信息
     * @author songyf 2020-08-12
     */
    @POST
    @Path("court-announcement-detail")
    @ApiOperation(value = "法院公告详情", notes = "法院公告详情")
    @ApiImplicitParam(name = "requestObj", dataType = "CourtAnnouncementDetailQueryReq", paramType = "body",
        required = true)
    @Override
    public ServiceResult<QccCourtAnnouncementDetailDTO>
        searchCourtAnnouncementDetail(@Valid CourtAnnouncementDetailQueryReq req) {
        ServiceResult<QccCourtAnnouncementDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchCourtAnnouncementDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "法院公告详情查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 被执行人核查信息查询
     *
     * @param req 企查查分页查询基础请求信息
     * @return 被执行人核查信息列表
     * @author liulx
     * @date 2020-08-18 17:47:29
     */
    @POST
    @Path("zhixing")
    @ApiOperation(value = "被执行人核查信息查询", notes = "被执行人核查信息查询")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<ZhiXingCheckResultDTO> listZhixing(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<ZhiXingCheckResultDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listZhixing(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "被执行人核查信息查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 被执行人核查详情信息查询
     *
     * @param req 企查查基本查询请求信息
     * @return 被执行人核查详情信息
     * @author liulx
     * @date 2020-08-18 17:47:29
     */
    @POST
    @Path("zhixing-detail")
    @ApiOperation(value = "被执行人核查详情信息查询", notes = "被执行人核查详情信息查询")
    @ApiImplicitParam(name = "requestObj", dataType = "QccBaseQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<ZhiXingDTO> getZhixingDetail(@Valid QccBaseQueryReq req) {
        ServiceResult<ZhiXingDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.getZhiXingDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "被执行人核查详情信息查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 失信详情
     *
     * @param req 查询失信详情信息
     * @return 失信详情信息
     * @author songyf 2020-08-19
     */
    @POST
    @Path("shixin-detail")
    @ApiOperation(value = "失信详情查询", notes = "失信详情查询")
    @ApiImplicitParam(name = "requestObj", dataType = "ShiXinDetailQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<ShiXinDTO> searchShiXinDetail(@Valid ShiXinDetailQueryReq req) {
        ServiceResult<ShiXinDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchShiXinDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "失信信息查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 失信核查
     *
     * @param req 查询失信核查信息
     * @return 失信核查信息
     * @author songyf 2020-08-12
     */
    @POST
    @Path("shixin")
    @ApiOperation(value = "失信核查查询", notes = "失信核查查询")
    @ApiImplicitParam(name = "requestObj", dataType = "ShiXinListQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<ShiXinListDTO> searchShiXinList(@Valid ShiXinListQueryReqPager req) {
        ServiceResult<ShiXinListDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchShiXinList(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "失信信息查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 获取股权冻结信息 create by songyf 2020-08-12
     * 
     * @param req 获取股权冻结信息
     * @return 股权冻结信息
     */
    @POST
    @Path("judicial-assistanc")
    @ApiOperation(value = "股权冻结核查,每页条数最大不超过20", notes = "股权冻结核查")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<JudicialAssistanceDTO>> searchJudicialAssistance(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<JudicialAssistanceDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchJudicialAssistance(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "股权冻结核查查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 获取股权冻结信息
     *
     * @param req 获取股权冻结信息
     * @return 股权冻结信息
     */
    @POST
    @Path("judicial-assistanc-detail")
    @ApiOperation(value = "股权冻结详情", notes = "股权冻结详情")
    @ApiImplicitParam(name = "requestObj", dataType = "JudicialAssistanceQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<JudicialAssistanceDetailDTO> searchJudicialAssistanceDetail(@Valid JudicialAssistanceQueryReq req) {
        ServiceResult<JudicialAssistanceDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.searchJudicialAssistanceDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "股权冻结详情查询服务异常, case: {}",
                    Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 立案信息列表查询
     *
     * @param req 企查查分页查询基础请求信息
     * @return 立案信息列表
     * @author liulx
     */
    @POST
    @Path("case-filing")
    @ApiOperation(value = "立案信息核查,每页条数最大不超过20", notes = "立案信息核查")
    @ApiImplicitParam(name = "requestObj", dataType = "CourtNoticeQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<CaseFilingDTO>> listCaseFiling(@Valid CourtNoticeQueryReqPager req) {
        ServiceResult<List<CaseFilingDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listCaseFiling(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "立案信息核查服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 查询立案详情信息
     *
     * @param req 企查查基本查询请求信息
     * @return 立案详情信息
     */
    @POST
    @Path("case-filing-detail")
    @ApiOperation(value = "立案信息详情", notes = "立案信息详情")
    @ApiImplicitParam(name = "requestObj", dataType = "QccBaseQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<CaseFilingDetailDTO> getCaseFiling(@Valid QccBaseQueryReq req) {
        ServiceResult<CaseFilingDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.getCaseFiling(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询立案信息详情服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

    /**
     * 查询股权出质列表
     *
     * @param req 企查查分页查询基础请求信息
     * @return 股权出质结果信息
     * @author liulx
     */
    @POST
    @Path("equity-pledged")
    @ApiOperation(value = "查询股权出质列表", notes = "查询股权出质列表信息")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<EquityPledgedResultDTO> listEquityPledged(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<EquityPledgedResultDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.listEquityPledged(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "查询股权出质列表服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 行政处罚核查列表查询
     *
     * @param req 行政处罚核查列表查询
     * @return 行政处罚核查列表查询
     * @author songyf
     */
    @POST
    @Path("administrative-penalties")
    @ApiOperation(value = "行政处罚核查列表查询", notes = "行政处罚核查列表查询")
    @ApiImplicitParam(name = "requestObj", dataType = "CompanyBaseQueryReqPager", paramType = "body", required = true)
    @Override
    public ServiceResult<List<AdminPenaltyCheckDTO>>
        getAdministrativePenaltiesList(@Valid CompanyBaseQueryReqPager req) {
        ServiceResult<List<AdminPenaltyCheckDTO>> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.getAdministrativePenaltiesList(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "立案信息列表查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        result.setPagerInfo(req.getPagerInfo());
        return result;
    }

    /**
     * 查询行政处罚详情(信用中国)信息
     *
     * @param req 企查查基本查询请求信息
     * @return 行政处罚详情信息
     * @author songyf
     */
    @POST
    @Path("administrative-penalties-detail")
    @ApiOperation(value = "查询行政处罚详情(信用中国)信息", notes = "查询行政处罚详情(信用中国)信息")
    @ApiImplicitParam(name = "requestObj", dataType = "QccBaseQueryReq", paramType = "body", required = true)
    @Override
    public ServiceResult<AdministrativePenaltiesDetailDTO>
        getAdministrativePenaltiesDetail(@Valid QccBaseQueryReq req) {
        ServiceResult<AdministrativePenaltiesDetailDTO> result = new ServiceResult<>();
        try {
            result.setResult(qccModel.getAdministrativePenaltiesDetail(req));
        } catch (BusinessException be) {
            result.setError(be.getCode(), be.getMessage());
        } catch (Exception e) {
            IfpLogger.error(Thread.currentThread().getStackTrace()[1].getMethodName(), "行政处罚详情查询服务异常, case: {}",
                Throwables.getStackTraceAsString(e));
            result.setError("ECCT0000", "服务异常，请联系系统管理员");
        }
        return result;
    }

}
